/********************************************************************************
 *      Copyright:  (C) 2023 LingYun IoT System Studio
 *                  All rights reserved.
 *
 *       Filename:  sht20.h
 *    Description:  This head file head of sht20.c.
 *
 *        Version:  1.0.0(2023年07月11日)
 *         Author:  Ling Yun <lingyun@email.com>
 *      ChangeLog:  1, Release initial version on "2023年07月11日 16时39分23秒"
 *                 
 ********************************************************************************/

#ifndef __SHT20_H__
#define __SHT20_H__

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <sys/stat.h>
#include <linux/i2c-dev.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <time.h>


#define SOFTRESET					0xFE
#define TRIGGER_TEMPERATURE_NO_HOLD	0xF3
#define TRIGGER_HUMIDITY_NO_HOLD	0XF5

#define SHT20_PATH					"/dev/i2c-0"

static inline void msleep(unsigned long ms);
int sht2x_init(void);
int sht2x_get_temp_humidity(int fd, unsigned char *buf_temp, unsigned char *buf_rh, float *temp, float *rh);

#endif

